<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <common-head></common-head>
  </div>
  <script src="./vue.js"></script>
  <script>

    // 定义一个 头部组件
    const CommonHead = {
      template: `
        <div>
          <h1>我是公共的头部组件</h1>  
          <h2>我是副标题</h2>
        </div>
      `
    }
    // 挂载到全局上
    Vue.component('CommonHead', CommonHead)
    const vm = new Vue({
      el: '#app'
    })
  </script>
</body>
</html>